package com.itheima.controller;

import com.itheima.domain.User;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ajax")
public class AjaxController {
    @RequestMapping("/test")
    public String test(String username){
        System.out.println("ajax controller...");
        return username;
    }

    @RequestMapping("/test1")
    public String test1(@RequestBody User user){
        System.out.println(user);
        return "ok";
    }

    @RequestMapping("/test2")
    public String test2(User user){
        System.out.println(user);
        return "ok";
    }
}
